import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Category from '@/views/category.vue'
import Order from '@/views/order.vue'
import Mine from '@/views/mine.vue'
import Cart from '@/views/cart.vue'

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    meta: {
      index: 1
    }
  },
  {
    path: '/category',
    name: 'category',
    component: Category
  },
  {
    path: '/order',
    name: 'order',
    component: Order
  },
  {
    path: '/user',
    name: 'user',
    component: Mine
  },
  {
    path: '/cart',
    name: 'cart',
    component: Cart
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
